#ifndef TCPSERVER_H
#define TCPSERVER_H
#include <QTcpServer>
#include <QTcpSocket>
#include <tcpclient.h>
#include <CommonHelper.h>
#include <dbHelper.h>

class TcpServer : public QTcpServer
{
    Q_OBJECT

public:
    static TcpServer* getInstance();
    TcpServer(QObject *parent = nullptr);
    ~TcpServer();
    void closeConnect();
    void sendData(QByteArray);

protected:
    void incomingConnection(qintptr socketDescriptor) override;
    QString GetDateString(int val);

private:
    static TcpServer* Instance;
    TcpClient *tcpClient;
    CommonHelper* common;
    QTcpSocket *socket;
};

#endif // TCPSERVER_H
